﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace DuplicateString
{
    class Program
    {
        static void Main(string[] args)
        {
            int counter = 0;
            string line;
            List<string> keys = new List<string>();
            List<string> dump = new List<string>();
            string FilePath = "C:\\awork\\Firebird\\Database\\Data\\ResourceMessage.csv";

            if (System.IO.File.Exists(FilePath)==false)
            {
                Console.WriteLine();
            }

            // Read the file and display it line by line.
            System.IO.StreamReader file =
               new System.IO.StreamReader(FilePath);
            while ((line = file.ReadLine()) != null)
            {
                //Console.WriteLine(line);
                string[] temp = line.Split(new char[] { ',' });
                if (keys.Contains(temp[0]) == false)
                {
                    keys.Add(temp[0]);
                }
                else if (temp[0].Contains('_') == true)
                {
                    Console.WriteLine(temp[0]);
                    dump.Add(temp[0]);
                    Console.WriteLine(counter + 1);
                }
                counter++;
            }

            file.Close();
        }
    }
}
